﻿using Abp.UI;

namespace ARchGL.Platform.Authorization.Roles
{
    public static class StaticRoleNames
    {
        /// <summary>
        /// 检查是否是系统信息，如果是则抛出异常
        /// </summary>
        /// <param name="name"></param>
        public static void CheckIsSystemInfo(string name)
        {
            if (name.Contains(Tenants.System))
                throw new UserFriendlyException("您的请求无效", "当前用户没有权限操作");
        }

        public static class Host
        {
            public const string Admin = "Admin";
        }

        public static class Tenants
        {
            /// <summary>
            /// 系统角色前缀
            /// </summary>
            public const string System = "SYSTEM_";

            /// <summary>
            /// 系统管理员
            /// </summary>
            public const string Admin = System + "Admin";
            /// <summary>
            /// 项目管理员
            /// </summary>
            public const string Project = System + "Project";
            /// <summary>
            /// 子公司管理员
            /// </summary>
            public const string BranchCompany = System + "BranchCompany";
            /// <summary>
            /// 普通用户
            /// </summary>
            public const string Normal = System + "Normal";
            /// <summary>
            /// 特定用户
            /// </summary>
            public const string Special = System + "Special";

            /// <summary>
            /// User
            /// </summary>
            public const string User = "User";
            /// <summary>
            /// 接口角色1，不允许从页面登录，不会出现在页面
            /// </summary>
            public const string InterfaceRole1 = System + "InterfaceRole1";
        }
    }
}